/**
 * 
 */
package com.bohai.weixin.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.bohai.base.web.controller.BaseController;
import com.bohai.weixin.model.TextMessage;
import com.bohai.weixin.util.MessageUtil;

/**
 * @author ricky
 *
 */
@Controller
public class TestController extends BaseController{

	@RequestMapping("/test/xmlbody") 
	public void test(Model model,HttpServletRequest request,HttpServletResponse response){
		 TextMessage textMessage = new TextMessage();  
         textMessage.setToUserName("1");  
         textMessage.setFromUserName("2");  
         textMessage.setCreateTime(System.currentTimeMillis());  
         textMessage.setMsgType("MsgType");  
         textMessage.setFuncFlag(0);  
         textMessage.setContent("既不是1也不是2"); 
         
         model.addAttribute(textMessage);
         
         this.returnMessage(response, MessageUtil.textMessageToXml(textMessage));
         return ;
			
	}
	
	@RequestMapping("/shiro-cas") 
	public void test2(Model model,HttpServletRequest request,HttpServletResponse response){
		 TextMessage textMessage = new TextMessage();  
         textMessage.setToUserName("2");  
         textMessage.setFromUserName("1");  
         textMessage.setCreateTime(System.currentTimeMillis());  
         textMessage.setMsgType("MsgType");  
         textMessage.setFuncFlag(0);  
         textMessage.setContent("既不是1也不是2"); 
         
         model.addAttribute(textMessage);
         
         this.returnMessage(response, MessageUtil.textMessageToXml(textMessage));
         return ;
			
	}
	
	
}
